package com.hhj.sharding.sphere.demo.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.hhj.sharding.sphere.demo.serializer.Long2StringSerializer;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * @author HHJ
 * @since 2024-05-22
 */
@Getter
@Setter
@TableName("tb_single_table")
@AllArgsConstructor
@NoArgsConstructor
public class SingleTable implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @JsonSerialize(using = Long2StringSerializer.class)
    private Long id;

    @TableField("code")
    private String code;

    @TableField("title")
    private String title;
}
